"use strict";
//封装Ajax
// 创建Ajax
const Ajax = (url, callback) => {
    //创建xhr
    const xhr = new XMLHttpRequest();
    //创建请求
    xhr.open('get', url);
    xhr.send();
    xhr.onreadystatechange = () => {
        if (xhr.status === 200 && xhr.readyState == 4) {
            //返回数据
            callback(JSON.parse(xhr.response));
        }
    };
};
